package cosc617_blackteam;

/**
 *
 * @author Anton
 */
public class CmdGetDefaultMenu implements I_Command
{
  private I_InfoAggregator infoAggr;
  public CmdGetDefaultMenu(I_InfoAggregator infoAggr)
  {
    this.infoAggr = infoAggr;
  }
  
  /*
   * @return a copy of the full menu.
   */
  @Override
  public Object execute()
  {
    I_MenuIterator dmi = this.infoAggr.getMenu().getDefaultMenuIterator();
    Menu defaultMenu = new Menu();
    while(dmi.hasNext())
    {
        defaultMenu.addMenuItem(dmi.next().copy());
    }
    return defaultMenu;
  }
}
